from routes.app import db
from sqlalchemy import Integer,BLOB,TIMESTAMP
from sqlalchemy.orm import relationship, Mapped,mapped_column
from datetime import datetime

from sqlalchemy.sql import func
from routes.app import app


class Image(db.Model):
    __tablename__ = 'image'
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    uid = db.Column(db.Integer, nullable=False)
    path = db.Column(db.String(100), nullable=False)
    created_at = db.Column(db.DateTime, server_default=db.func.now())
    filename = db.Column(db.String(100), nullable=False)
    def getId(self):
        return self.id
    def getUid(self):
        return self.uid
    def getPath(self):
        return self.path
    def getCreatedAt(self):
        return self.createdat
    def getFilename(self):
        return self.filename


